import request from "@/utils/request.js"

const API = {
    SAVE_STORE: '/store',
    DEL_STORE_BY_ID: '/store',
    UPDATE_STORE: '/store',
    PAGE_STORE: '/store/page',
    DISABLE_STORE: '/store/ban',
    LIST_STORE_NAME: '/store/list/name',
}

// 新增分店
export const reqSaveStore = (requestParam) => request.post(API.SAVE_STORE, requestParam)

// 删除分店
export const reqDeleteStoreById = (id) => request.delete(API.DEL_STORE_BY_ID, { params: { id } })

// 修改分店
export const reqUpdateStore = (requestParam) => request.put(API.UPDATE_STORE, requestParam)

export const reqDisableOrEnableStore = (id, banFlag) => request.put(API.DISABLE_STORE, null, { params: { id: id, banFlag: banFlag}})
// 分页查询分店
export const reqPageStore = (pn, ps)=> request.get(API.PAGE_STORE, { params: { pn, ps } })

// 列出分店名字
export const reqStoreNameList = () => request.get(API.LIST_STORE_NAME)
